﻿package plugin.unionChat
{
    import com.core.*;

    public class UnionChatControl extends Control
    {

        public function UnionChatControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            if (param1.getName() == "chat")
            {
                if (param2.property == "normalmsg")
                {
                    this.target.updateMsg(1, param2.newvalue);
                }
            }
            else if (param1.getName() == "union")
            {
                if (param2.property == "notice")
                {
                    this.target.updateMsg(2, param2.newvalue);
                }
                else if (param2.property == "getUnionInfo")
                {
                    this.target.updateMsg(3, null);
                }
                else if (param2.property == "updateMembers")
                {
                    this.target.updateMsg(3, null);
                }
                else if (param2.property == "changePosition")
                {
                    this.target.updateMsg(3, null);
                }
                else if (param2.property == "unioninfo")
                {
                    if (ModelProxy.getValue("data", "unionChatDelay"))
                    {
                        ModelProxy.change("data", "unionChatDelay", false);
                        this.target.visible = true;
                        this.target.setMsg(param2.newvalue);
                    }
                }
            }
            return;
        }// end function

    }
}
